﻿using System;
using System.Collections.Generic;
using System.Text;

namespace shun.PAPLib.Helper
{
    public class AddressCheck
    {
        /// <summary>
        /// 检查及转换号码为标准格式
        /// </summary>
        /// <param name="phone"></param>
        /// <returns></returns>
        public static string CheckNum(string phone)
        {
            if (!phone.StartsWith("+86") && phone.Length == 11)
            {
                phone = "+86" + phone;
            }
            else if (!(phone.Length == 14))
            {
                phone = String.Empty;
            }
            return phone;
        }

        /// <summary>
        /// 转换接收号码为PPG的格式
        /// </summary>
        /// <param name="phone"></param>
        /// <returns></returns>
        public static string ParseNum(string phone)
        {
            return "wappush=" + phone + "/type=PLMN@ppg.operator.com";
        }
    }
}
